/*
 * @Author: luoqi
 * @Date: 2022-04-04 17:36:42
 * @LastEditors: luoqi
 * @LastEditTime: 2022-04-07 10:10:24
 * @Description: 
 */
import {GETPRETYPE} from './constent'
import axios from '../utils/axios'
import qs from 'qs'
//获取全部一级分类
export function getTypeListAsync(){
  return function(dispatch){
    //获取按部位的分类
    axios({
      url:'classify/getClassifyTree',
      method:'post',
      data:qs.stringify({type:0})
    }).then(res=>{
      // console.log(res);
      if(res.code==='200'){
       let typeArr=res.data;
       console.log(typeArr)
       dispatch(getType(typeArr))
       //获取按科室的分类
     
      }
    })
  }
}
//同步action
export function getType(data){
  return {type:GETPRETYPE,data:data}
}